import {
	observer
} from 'mobx-react';
import {
	WeaSearchGroup,
} from 'ecCom';
import LinkageForm from './LinkageForm';

@observer
export default class LinkageFormUnderSearchGroup extends React.Component {
	constructor(props) {
		super(props);
	}

	render() {
		const {
			store,
			title,
			formContainer,
		} = this.props, {
			linkage,
			onFormChange,
			sgHelpfulTip,
		} = store;

		const children = <LinkageForm ecId={`${this && this.props && this.props.ecId || ''}_LinkageForm@9tiqo5`} linkage={linkage} {...formContainer} onFormChange={onFormChange}/>

		let titleTip;
		if (sgHelpfulTip) {
			titleTip = {
				title: <span dangerouslySetInnerHTML = {{ __html: sgHelpfulTip }}/>
			}
		}
		return (
			<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@darphp`} 
				center 
				showGroup 
				titleTip={titleTip}
				title={title} 
				children={children} />
		);
	}
}